Answer:

5    6     7     8     9    10

The statement

FOR I = 5 TO 10 

says that I will get the values 5 through 10. Each value will be PRINTed. The semicolon after the I in the PRINT statement keeps the output on one line. (This is a picky detail, but useful for presenting compact examples.)

Syntax of the FOR Statement

In general, the FOR statement looks like this:

FOR counter = startingValue TO endingValue
  loopBody
NEXT counter

Remember that the term syntax means "the grammar of a program." Syntax tells you how a program (or part of a program) should look. Here are some rules about FOR statements:

  1. The counter is a numeric variable.
  2. You can use counter in the loopBody, but don't change it (this happens automatically with the NEXT.)
  3. startingValue and endingValue can be arithmetic expressions or variables.
  4. loopBody can be any number of statements.
  5. NEXT counter shows the end of the loop body, and shows where counter will change to its next value.

These rules look worse than they are. A few examples will make them clear. Here is a correct program:

' Counting Loop 
'
LET START = 1
LET FINISH = 5
FOR I = START TO FINISH
  PRINT I;         
NEXT I        
END

QUESTION 7:

Find at least 4 rules from the above list that this program illustrates.